import request from '@/utils/request'

/**
 * 获取订单状态分布
 * GET /api/dashboard/order-status-distribution
 * 返回: [{ status: number, count: number }, …]
 */
export const getOrderStatusDistribution = () =>
  request.get('/api/dashboard/order-status-distribution')

/**
 * 获取商品销量排行榜 (Top N)
 * GET /api/dashboard/top-selling-skus?topN=10
 * 返回: [{ skuName: string, sales: number }, …]
 * @param {number} topN - 取前 N 名，默认 10
 */
export const getTopSellingSkus = (topN = 10) =>
  request.get('/api/dashboard/top-selling-skus', {
    params: { topN }
  })

/**
 * 获取促销活动参与度对比
 * GET /api/dashboard/promotion-participation
 * 返回: [{ activityName: string, quantity: number }, …]
 */
export const getPromotionParticipation = () =>
  request.get('/api/dashboard/promotion-participation')

/**
 * 获取评价星级分布
 * GET /api/dashboard/evaluation-rating-distribution
 * 返回: [{ score: number, count: number }, …]
 */
export const getEvaluationRatingDistribution = () =>
  request.get('/api/dashboard/evaluation-rating-distribution')
